package grape.base.rest.user.vo;

import grape.base.rest.application.vo.ApplicationVo;
import grape.base.rest.dataconstraint.vo.DataScopeVo;
import grape.base.rest.func.vo.FuncVo;
import grape.base.rest.post.vo.PostVo;
import grape.base.rest.role.vo.RoleVo;
import grape.base.rest.userpost.vo.UserPostVo;
import grape.base.service.dict.api.IDictService;
import grape.base.service.user.api.IUserService;
import grape.common.rest.vo.BaseVo;
import grape.common.service.trans.TransBy;
import grape.common.service.trans.TransField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * Created by yangwei
 * Created at 2019/9/27 15:56
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Accessors(chain = true)
@ApiModel(value="用户详细信息")
public class UserinfoVo extends BaseVo {

    @ApiModelProperty(value = "当前登录用户id")
    private String id;

    @ApiModelProperty(value = "登录方式字典id")
    private String identifierTypeLoginDictId;

    @TransBy(type = IDictService.trans_dictCode,byFieldName = "identifierTypeLoginDictId")
    @ApiModelProperty(value = "登录方式字典编码")
    private String identifierTypeLoginDictCode;

    @TransBy(type = IDictService.trans_dictName,byFieldName = "identifierTypeLoginDictId")
    @ApiModelProperty(value = "登录方式字典名称")
    private String identifierTypeLoginDictName;

    @ApiModelProperty(value = "是否超级管理员")
    private Boolean isSuperAdmin;

    @TransField
    @ApiModelProperty(value = "用户信息")
    private UserVo user;

    @TransField
    @ApiModelProperty(value = "用户岗位信息")
    private List<UserPostVo> userPosts;

    @TransField
    @ApiModelProperty(value = "用户角色信息，未分组的所有角色")
    private List<RoleVo> roleVos;

    @TransField
    @ApiModelProperty(value = "用户角色信息，补充分组信息")
    private List<UserinfoAdditionalVo<RoleVo>> roleAddtionalVos;

    @TransField
    @ApiModelProperty(value = "用户功能信息，未分组的所有功能")
    private List<FuncVo> funcVos;

    @TransField
    @ApiModelProperty(value = "用户功能信息，补充分组信息")
    private List<UserinfoAdditionalVo<FuncVo>> funcAddtionalVos;

    @TransField
    @ApiModelProperty(value = "用户数据范围约束信息，未分组的所有数据范围约束")
    private List<DataScopeVo> dataScopeVos;

    @TransField
    @ApiModelProperty(value = "用户数据范围约束信息，补充分组信息")
    private List<UserinfoAdditionalVo<DataScopeVo>> dataScopeAddtionalVos;

}